package com.bm.api.controller;

import com.bm.api.service.MyfriendService;
import com.bm.common.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * .=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.
 * |                     ______                     |
 * |                  .-"      "-.                  |
 * |                 /            \                 |
 * |     _          |              |          _     |
 * |    ( \         |,  .-.  .-.  ,|         / )    |
 * |     > "=._     | )(__/  \__)( |     _.=" <     |
 * |    (_/"=._"=._ |/     /\     \| _.="_.="\_)    |
 * |           "=._"(_     ^^     _)"_.="           |
 * |               "=\__|IIIIII|__/="               |
 * |              _.="| \IIIIII/ |"=._              |
 * |    _     _.="_.="\          /"=._"=._     _    |
 * |   ( \_.="_.="     `--------`     "=._"=._/ )   |
 * |    > _.="                            "=._ <    |
 * |   (_/                                    \_)   |
 * |                                                |
 * '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='
 * -----------------代码的搬运工-----------------
 *
 * @Date: 2022/07/20/21:05
 */
@RestController
@RequestMapping("/api/myfriend/")
@Api(tags = "好友相关操作-谢英凡")
public class MyfriendController {
    @Resource
    private MyfriendService service;
    @ApiOperation(value = "添加好友")
    @GetMapping("save.do")
    public R save(@RequestParam int uid, @RequestParam String friendid){
        return service.save(uid,friendid);
    }
    @GetMapping("isfriend.do")
    @ApiOperation(value = "判断当前账号是否为好友")
    public R isfriend(@RequestParam int uid,@RequestParam String friendid){
        return service.isfriend(uid, friendid);
    }
    @GetMapping("selectmyfriend")
    @ApiOperation(value = "查询我的好友列表")
    public R selectmyfriend(@RequestParam int uid){
        return service.selectmyfriend(uid);
    }
    @GetMapping("deleteByUid")
    @ApiOperation(value = "删除好友")
    public R delete(@RequestParam int uid,@RequestParam String friendid){
        return service.delete(uid,friendid);

    }
}
